package com.example.demo.study.opp;

import java.util.Scanner;

public class ScannerTest {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
         Boolean flag = true;
//        do{
//            System.out.print("请输入一个整数：");
//            int num = scanner.nextInt();
//            System.out.println("您输入的整数是：" + num);
//            if(num == 0){
//                flag = false;
//                System.out.println("程序结束！");
//                break;
//            }
//        }while (flag);
        do{
            System.out.print("请输入内容：");
            String name = scanner.next();
            System.out.println("您输入的内容是：" + name);
            if(name.equals("yes")){
                flag = false;
                System.out.println("程序结束！");
                break;
            }
        }while (flag);
    }
}
